<!doctype html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>进销管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="../public/css/font.css">
    <link rel="stylesheet" href="../public/css/login.css">
    <link rel="stylesheet" href="../public/css/xadmin.css">
    <script type="text/javascript" src="../public/js/jquery.min.js"></script>
    <script src="../public/lib/layui/layui.js" charset="utf-8"></script>
</head>
<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">进销管理系统</div>
    <div id="darkbannerwrap"></div>

    <form id="loginForm" method="post" class="layui-form">
        <input name="username" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
        <hr class="hr15">
        <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
        <hr class="hr20">
        <hr class="hr20">
        <hr class="hr20">
        <input value="登录" id="loginBtn" style="width:100%;" type="button">
        <hr class="hr20">
    </form>
</div>

<script>
    var loginForm;
    var loginBtn;

    $(function () {
        loginForm = $("#loginForm");
        loginBtn = $("#loginBtn");

        loginBtn.click(function () {
            var formArray = loginForm.serializeArray();
            // console.log(formArray);

            $.ajax({
                type: "POST",
                url: "/user/login",
                data: formArray,
                dataType: "json",
                success: function (data) {
                    window.location.href = "/pages/index.html?uid=" + data.uid;
                }
            });
        });


    })
</script>
<!-- 底部结束 -->
</body>
</html>